<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="format-detection" content="telephone=no,email=no,adress=no"/>
<title>先花花</title>
<link rel="stylesheet" type="text/css" href="css/common.css" />
<script type="text/javascript" src="script/jquery.js"></script>
  <script type="text/javascript" src="script/jquery.md5.js"></script>
<script type="text/javascript" src="script/common.js"></script>
<script type="text/javascript" src="script/jquery.cookie.js"></script>
<script type="text/javascript">
  $(function(){
    uid = $.cookie("userid");
    $(document).on("click",".repay",function(){
      var bid = $(this).attr("bid");
      var storage=window.localStorage;
      storage["bid"] = bid;
      window.location.href="detail.html";
    });
    $.ajax({
          url:"http://47.93.21.169/old/TP5/public/index.php/index/Borrow/getData",
          data:{uid:uid},
          type:"get",
          dataType:"jsonp",
          jsonp:"callback",
          success:function(result){
            if(result.status==200){
              tihuan(result.data)
            }else{
              $("#touzi").attr("display","");
            }
          }
      });;
  });
  function tihuan(data)
  {
    var str='';
    /*var month = '';
     month+='<tr class="details" style="display:none;"><td>期数</td><td>本金</td><td>利息</td><td>本金加利息</td></tr>';*/
    $.each(data,function(n,v){
      var a= '';
      if(v.repayStatus!=1){
         a+='<c style="cursor:pointer;" class="repay"  bid='+v.bid+'>&nbsp;&nbsp;详情</c></td></tr>'
      }
     str+='<tr><td align="left" width="40%" style="padding-left:10px; color:#4A4A4A;">'+v.time+'<span class="tbline"></span> </td><td style="color:#0caffe;" align="center"><span class="tbline"></span><i>'+v.repayMoney+'</i></td><td>'+v.long+'天</td><td align="right" style="padding-right:10px;"><a href="#">'+v.status1+'</a></td><td align="right">'+v.fangshi+a;
/*     $.each(v.evMonth,function(na,val){
        month+='<tr class="details" style="display:none;"><td>'+val.periods+'</td><td>'+val.principal+'</td><td>'+val.interest+'</td><td>'+val.sum+'</td></tr>';
     });*/
    });
    $("#box").append(str);
    // $("#box").append(month);
  }
</script>
</head>
<body>
<!-- 页面头部 -->
<section>
 <div class="navigation-bar"> <a href="javascript:history.back(-1)" class="z-01"></a> <span>借款记录</span> <a href="index.html" class="z-02"></a> </div>
</section>
<!-- 中间内容 -->
<div class="wrapper">
  <div class="personalform">
    <div class="tzjl-con1" id="touzi" style="min-height:150px;padding-top:100px;text-align:center;background-color:#fff; display:none">您最近还没有投资记录！ </div>
	  <div class="c-tabs-cnt c-tzjlinfo" style=" padding-bottom:60px;">
          <table style="width: 100%">
            <tbody id="box">
              <tr>
                <th align="left" width="10%">借款时间<span class="tbline"></span></th>
                <th width="10%" style="padding-left:10px;" align="left">金额(元)<span class="tbline"></span></th>
                <th width="20%" align="center">借多久<span class="tbline" style="margin-top:15px;"></span></th>
                <th align="right" width="10%" style="padding-right:10px;">申请状态</th>
                <th align="right" width="20%" style="padding-right:10px;">还款方式</th>
              </tr>

            </tbody>
          </table>
          <div class="clear"></div>
          <div class="addmore"><a href="#" title="查看更多" class="btn-ckgd">查看更多↓</a> </div>
      </div>
  </div>
  <div class="clear"></div>
</div>
<!-- 页面底部 -->
<nav class="footer border_t" id="footer"> 
  <a href="index.html" class="" id="jx"><span></span>首页</a>
   <a href="list.html" id="lc" class=""><span></span>理财</a> 
  <a href="borrow_money.html" id="jk" class=""><span></span>借款</a>
   <a href="user.html" id="cf" class="nav_on"><span></span>我的账户</a> </nav>
</body>
</html>
